﻿/* 
 * author: www.cnblogs.com/luminji
 * date  : 2011/12/14
 */
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.Configuration;

namespace Luminji.Core.Enterprise
{
    public static class UnityObjectFactory
    {
        public static TOut GetInstance<TOut>(IUnityContainer container)
        {
            if (container == null)
            {
                throw new ArgumentNullException("container");
            }
            return container.Resolve<TOut>();
        }

        public static TOut GetInstance<TOut>(IUnityContainer container, string rigsterClassName)
        {
            if (container == null)
            {
                throw new ArgumentNullException("container");
            }
            return container.Resolve<TOut>(rigsterClassName);
        }
    }
}
